
<div :class="[$store.state.appPrefix + '-p-manager-comon', $store.state.appPrefix + '-p-period-comon']" data-table-extra="150">
  <div class="info-header">
    人员账号
  </div>
  <div class="g-table-layout">
    <div class="g-table-top g-table-top-action__flex g-table-top-action__flex--br">
      <div class="g-table-top-action__left">
        <el-search
          size="small"
          v-model="filterForm.q"
          class="g-table-top-action__left--block g-table-top-action__left--row"
          isBasic
          @search="$search"
          @clear="() => {filterForm.q = ''; $search()}"
          placeholder="请输入姓名或账号查询">
        </el-search>
        <el-select
          class="g-table-top-action__left--block g-table-top-action__left--row"
          v-model="filterForm.userLable"
          placeholder="选择标签"
          clearable
          @change="$search">
          <el-option
            v-for="item in userLabels"
            :key="item"
            :label="item"
            :value="item">
          </el-option>
        </el-select>
        <el-select
          class="g-table-top-action__left--block g-table-top-action__left--row"
          v-model="filterForm.enabled"
          placeholder="选择状态"
          clearable
          @change="$search">
          <el-option
            v-for="item in EXPIRED_STATUS"
            :key="item.codeNum"
            :label="item.codeName"
            :value="item.codeNum">
          </el-option>
        </el-select>
      </div>
      <div class="g-table-top-action__right">
        <el-button size="small" icon="el-icon-upload" @click="$handleImport">批量导入人员</el-button>
        <el-button size="small" type="primary" icon="el-icon-plus" @click="$handleAdd">添加人员</el-button>
      </div>
    </div>
    <!--  -->
    <el-table v-loading="isPageLoading" :height="tableHeight" :data="tableList" :default-sort="{ prop: 'createTime', order: 'descending' }" @sort-change="$sortChange">
      <el-table-column
        label="序号"
        type="index"
        :index="indexMethod">
      </el-table-column>
      <el-table-column
        v-for="col in COL_INDEXS"
        :key="col.prop"
        :prop="col.prop"
        :label="col.label"
        :sortable="col.isSort ? 'custom' : false"
        show-overflow-tooltip
        :min-width="120">
        <template slot-scope="scope">
          <span v-if="col.isDict">{{(EXPIRED_STATUS[scope.row[col.prop]] || {}).codeName}}</span>
          <span v-else-if="col.isExtra">
            {{scope.row[col.prop] ? scope.row[col.prop] : ''}}
            <el-tag v-if="parseInt(scope.row.enabled, 10) === 1" type="danger" size="mini">禁用</el-tag>
          </span>
          <span v-else>{{scope.row[col.prop] | filterBlank}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        fixed="right"
        :width="180"
        class-name="no-ellipsis">
        <template slot-scope="scope">
          <div class="btns">
            <el-button type="text" size="medium" @click="$handleRecord(scope.row)">学习记录</el-button>
            <el-button type="text" size="medium" @click="$handleEdit(scope.row)">编辑</el-button>
            <el-button type="text" size="medium" @click="$handleDelete(scope.row)">删除</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      class="g-table-bottom g-pagination"
      background
      :hide-on-single-page="true"
      :layout="PAGE_CONFIG.simpleLayout"
      :total="totalCount"
      :page-size="pageSize"
      :current-page.sync="pageNo"
      @current-change="$handlePageChange">
    </el-pagination>
  </div>
</div>
